import request from '@/utils/request'

export default {
  // 查询章节树
  getChapterTree(courseId) {
    return request({
      url: `/eduService/chapter/getAllChapter/${courseId}`,
      method: 'get'
    })
  },

  // 添加章节
  addChapter(chapter) {
    return request({
      url: `/eduService/chapter/addChapter/`,
      method: 'post',
      data: chapter
    })
  },

  // 修改章节
  updateChapter(chapter) {
    return request({
      url: `/eduService/chapter/updateChapter/`,
      method: 'post',
      data: chapter
    })
  },

  // 查询章节
  getChapterById(chapterId) {
    return request({
      url: `/eduService/chapter/getChapterById/${chapterId}`,
      method: 'get'
    })
  },

  // 删除章节
  deleteChapterById(chapterId) {
    return request({
      url: `/eduService/chapter/deleteChapter/${chapterId}`,
      method: 'delete'
    })
  }
}
